/*
 * @Author: Clark
 * @Email: haixuanwoTxh@gmail.com
 * @Date: 2023-01-04 18:14:33
 * @LastEditors: Clark
 * @LastEditTime: 2023-01-04 18:15:44
 * @Description: file content
 */

#include "apue.h"

static void my_exit1(void);
static void my_exit2(void);

int main()
{
    if (0 != atexit(my_exit2))
    {
        err_sys("can't register my_exit2");
    }

    if (0 != atexit(my_exit1))
    {
        err_sys("can't register my_exit1");
    }

    if (0 != atexit(my_exit1))
    {
        err_sys("can't register my_exit1");
    }

    printf("'main is done\n");
    return 0;
}

static void my_exit1(void)
{
    printf("first exit handler\n");
}

static void my_exit2(void)
{
    printf("second exit handler\n");
}
